package service;

import dao.AddDao;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class AddService {
    public void addDService(String sName, int price) {
        AddDao ad = new AddDao();
        String date = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
        if (ad.addDDao(sName, price, date)) {
            System.out.println("添加成功！");
        } else {
            System.out.println("添加失败");
        }
    }
}
